﻿@using Tateeda.ClinicalStudy.Base.Modules.Common.Enumeration;
@using Tateeda.ClinicalStudy.Base.Modules.Models.StudyForm;
@model StudyFormModel
@{
    ViewBag.Title = "Form Pre-View";
    Layout = "~/Views/Shared/_ClinicianLayout.cshtml";
}
@using (Html.BeginForm("SaveFinish", "StudyForm", FormMethod.Post, new { @id = "frmStudyForm" })) {
    @Html.Hidden("formId", Model.FormId)
    @Html.Hidden("apid", (int)ViewBag.AppointmentId)
    @Html.Hidden("returnTo", (string)ViewBag.ReturnTo)

    <fieldset>
        <legend>@Model.Name - [@Model.Code]</legend>
        @Html.Partial("_FormHeader", Model)
        <hr />
        @{
    switch (Model.LayoutType.Value) {
        case (int)FormLayoutType.Horizontal:
            @Html.Partial("_HorizontalFormView", Model)
       break;
        case (int)FormLayoutType.Vertical:
            @Html.Partial("_VerticalFormView", Model)
       break;
        case (int)FormLayoutType.TwoColumns:
            @Html.Partial("_TwoColumnsFormView", Model)
       break;
        default:
            @Html.Partial("_VerticalFormView", Model)
       break;
    }
        }
        <br />
        <p>
            <input type="button" value="Save and Continue" onclick="SaveAndContinue();" class="saveAndContinue"
                style="width: 170px;" />
            <input type="submit" value="Save and Finish" onclick="SaveAndFiish();" class="validateForm saveAndFinish" style="width: 170px;" />
        </p>
        @Html.Partial("_FormFooter", Model)
    </fieldset>
}